package com.hst.capacity.infra.persistence.jpa;

import com.alicp.jetcache.anno.Cached;
import com.hst.capacity.domain.model.entity.auth.TokenEntity;
import org.springframework.data.repository.CrudRepository;

public interface TokenRepository extends CrudRepository<TokenEntity, String> {

    /**
     * 查找Token，By Access Token
     *
     * @param accessToken
     * @return
     */
    @Cached(name = "tokenCache::", key = "#accessToken", expire = 600)
    TokenEntity findByAccessToken(String accessToken);

}
